package com.ruoyi.relationOrder.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 分销订单关联对象 wdmd_distribution_order_relation
 * 
 * @author ruoyi
 * @date 2025-11-07
 */
@Data
public class DistributionOrderRelation extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 关联ID（主键） */
    private Long relationId;

    /** 订单ID（关联你的普通订单表主键） */
    @Excel(name = "订单ID", readConverterExp = "关=联你的普通订单表主键")
    private Long orderId;

    /** 订单编号 */
    @Excel(name = "订单编号")
    private String orderCode;

    /** 一级分销员ID */
    @Excel(name = "一级分销员ID")
    private Long firstDistributorId;

    /** 二级分销员ID */
    @Excel(name = "二级分销员ID")
    private Long secondDistributorId;

    /** 分销状态：0-待支付 1-待结算 2-已结算 3-已取消 4-已扣回 */
    @Excel(name = "分销状态：0-待支付 1-待结算 2-已结算 3-已取消 4-已扣回")
    private String distributionStatus;

    /** 结算时间（T+7天后自动更新） */
    @Excel(name = "结算时间", readConverterExp = "T=+7天后自动更新")
    private Date settlementTime;

    /** 取消原因（如订单退款、分销员禁用） */
    @Excel(name = "取消原因", readConverterExp = "如=订单退款、分销员禁用")
    private String cancelReason;

    /** 删除标志（0存在 2删除） */
    private String delFlag;

    /** 版本号（乐观锁） */
    @Excel(name = "版本号", readConverterExp = "乐=观锁")
    private Long version;

    /** 状态（0=上架 1=下架） */
    @Excel(name = "状态", readConverterExp = "0==上架,1==下架")
    private String status;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("relationId", getRelationId())
            .append("orderId", getOrderId())
            .append("orderCode", getOrderCode())
            .append("firstDistributorId", getFirstDistributorId())
            .append("secondDistributorId", getSecondDistributorId())
            .append("distributionStatus", getDistributionStatus())
            .append("settlementTime", getSettlementTime())
            .append("cancelReason", getCancelReason())
            .append("delFlag", getDelFlag())
            .append("version", getVersion())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("remark", getRemark())
            .append("status", getStatus())
            .toString();
    }
}
